/**
 * Copyright (C) 2009-2012, KingHool.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses.
 */
package com.kinghool.smodel.test;

import java.sql.Timestamp;
import java.util.Date;

import com.kinghool.smodel.io.bean.annotation.Attribute;
import com.kinghool.smodel.io.bean.annotation.Bean;
import com.kinghool.smodel.io.bean.annotation.Include;

/**
 * 
 * @Author Allen Deng(dengtailin@gmail.com)
 */
@Bean(includeAll = false)
public class Item {
	@Attribute
	@Include
	private String id;

	@Attribute
	@Include
	private String name;

	@Attribute
	@Include
	private double price;

	@Attribute
	@Include
	private int count;

	/**
	 * default is text with child name <code>description</code>
	 */
	@Include
	private String description;

	/**
	 * the property of includeAll of Item is false, 
	 * only the property marked with @Include will be serialized
	 * createTime will be ignored 
	 */
	private Timestamp createTime;
	
	/**
	 * the property of includeAll of Item is false, 
	 * only the property marked with @Include will be serialized
	 * order will be ignored  
	 */
	private Order order;

	public Item() {
		this.createTime = new Timestamp(new Date().getTime());
	}
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Timestamp getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}
}